#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "nameSpace.h"
#include "imuWidget.h"
#include "compassWidget.h"
#include "pressureWidget.h"
#include "gpsWidget.h"
#include "pressureWidget.h"
#include "ultraSonicWidget.h"
#include "controlWidget.h"


QString globalServer();

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:

    RPIHelicopterClient *client;
    accelerometerWidget *accelerometerW;
    gyroscopeWidget *gyroscopeW;
    pressureWidget *pressureW;
    controlsWidget *controlsW;
    ultrasonicSensoresWidget *ultrasonicSensoresW;
    compassWidget *compassW;
    gpsWidget *gpsW;
    Marble::MarbleWidget *mapW;
    videoWidget *videoW;

    vtkGraphicsWidget *vtkW;
    vtkGraphics *vtk;

    imuWidget *imuW;
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    
private:
    Ui::MainWindow *ui;
public slots:
        void connectBtnPressed();
        void saveDockState();
        void loadDockState();
        void closeEvent(QCloseEvent *event);
        void steerTo(int s);
        void setMotorPower(int p);
        void moveForward();
        void moveBackward();
        void setAccXYZT(double *z);

public slots:
        void connectMBtnClicked();
        void disconnectMBtnClicked();
        void configureAccelerometerMBtnClicked();
        void configureGyroscopeMBtnClicked();
        void configureCompassMBtnClicked();
        void configurePressureMBtnClicked();
        void configureGPSMBtnClicked();
        void insertUltrasonicMBtnClicked();
        void insertcontrolMBtnClicked();
        void removeUltrasonicMBtnClicked();
        void removecontrolMBtnClicked();
        void unableToConnect();
        void lostConnection();
        void setMapCentre(double lat,double longit);
        void Connected();
        void socketError(QAbstractSocket::SocketError e);
};
#endif // MAINWINDOW_H
